\documentclass[12pt,openright,twoside]{book}

% XeLaTeX specific packages
\usepackage{fontspec}

% Font settings for professional appearance - use system defaults first
\defaultfontfeatures{Ligatures=TeX}

% Essential packages
\usepackage[english]{babel}
\usepackage{geometry}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{tocloft}
\usepackage{enumitem}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{array}
\usepackage{float}

% Code highlighting with listings (more compatible)
\usepackage{listings}
\usepackage{xcolor}

% Define colors for syntax highlighting
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}

% Configure listings
\lstdefinestyle{mystyle}{
    backgroundcolor=\color{backcolour},   
    commentstyle=\color{codegreen},
    keywordstyle=\color{blue},
    numberstyle=\tiny\color{codegray},
    stringstyle=\color{codepurple},
    basicstyle=\ttfamily\footnotesize,
    breakatwhitespace=false,         
    breaklines=true,                 
    captionpos=b,                    
    keepspaces=true,                 
    numbers=left,                    
    numbersep=5pt,                  
    showspaces=false,                
    showstringspaces=false,
    showtabs=false,                  
    tabsize=2
}

\lstset{style=mystyle}

% Page geometry
\geometry{
    paper=letterpaper,
    inner=1.2in,
    outer=1in,
    top=1in,
    bottom=1in,
    headheight=15pt,
    headsep=0.25in,
    footskip=0.5in
}

% Hyperref setup
\hypersetup{
    colorlinks=true,
    linkcolor=blue!50!black,
    urlcolor=blue!50!black,
    citecolor=blue!50!black,
    bookmarksopen=true,
    bookmarksnumbered=true,
    pdftitle={The Development of Project Based on Claude Code: Prompts Templates and Procedures},
    pdfauthor={Claude Code Development Guide},
    pdfsubject={Software Development Guide},
    pdfkeywords={Claude Code, AI Development, Programming, Templates}
}

% Header and footer styling
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE]{\leftmark}
\fancyhead[RO]{\rightmark}
\fancyfoot[LE,RO]{\thepage}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0pt}

% Chapter and section styling
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}

\titleformat{\section}
{\normalfont\Large\bfseries}{\thesection}{1em}{}

\titleformat{\subsection}
{\normalfont\large\bfseries}{\thesubsection}{1em}{}

\titleformat{\subsubsection}
{\normalfont\normalsize\bfseries}{\thesubsubsection}{1em}{}

% Table of contents styling
\setlength{\cftbeforechapskip}{6pt}
\renewcommand{\cftchapfont}{\bfseries}
\renewcommand{\cftchappagefont}{\bfseries}

% Custom environments for code blocks and templates
\newenvironment{codebox}[1][]%
{\begin{tcolorbox}[colback=gray!10,colframe=gray!50,title=#1,fonttitle=\bfseries]}%
{\end{tcolorbox}}

% Load tcolorbox for better code formatting
\usepackage[most]{tcolorbox}

% Document information
\title{%
    {\Huge The Development of Project Based on Claude Code}\\[0.5em]
    {\Large Prompts Templates and Procedures}\\[1em]
    {\normalsize A comprehensive guide to mastering project-based development with Claude Code}
}
\author{Generated from Real Claude Code Sessions}
\date{\today}

\begin{document}

% Title page
\frontmatter
\maketitle

% Table of Contents
\tableofcontents
\cleardoublepage

% Main content
\mainmatter

% Part I: Foundation
\part{Foundation}
\input{chapters/01-introduction-new}
\input{chapters/02-task-classification-new}
\input{chapters/03-core-principles-new}

% Part II: Task Type Mastery  
\part{Task Type Mastery}
\input{chapters/04-system-architecture-planning}
\input{chapters/05-code-debugging-builds}
\input{chapters/06-package-development-new}
\input{chapters/07-web-development-apis}
\input{chapters/08-language-specific-dev}
\input{chapters/09-data-processing-analysis}
\input{chapters/10-ai-ml-integration}
\input{chapters/11-scientific-computing}
\input{chapters/12-documentation-wiki}
\input{chapters/13-content-generation}
\input{chapters/14-visualization-diagramming}
\input{chapters/15-infrastructure-devops}
\input{chapters/16-database-management}
\input{chapters/17-authentication-security}
\input{chapters/18-testing-qa}
\input{chapters/19-config-environment}
\input{chapters/20-monitoring-analytics}
\input{chapters/21-research-academic}
\input{chapters/22-integration-orchestration}

% Part III: Advanced Topics
\part{Advanced Topics}
\input{chapters/23-multi-task-workflows}
\input{chapters/24-prompt-engineering}
\input{chapters/25-agent-coordination}
\input{chapters/26-troubleshooting}
\input{chapters/27-paper-writing-templates}

% Appendices
\appendix
\part{Appendices}
\input{chapters/appendix-a-templates-new}
\input{chapters/appendix-b-patterns}
\input{chapters/appendix-c-tools}
\input{chapters/appendix-d-examples}

\end{document}